count the number of characters in a string java